package app.core.model.impl;

import java.net.Socket;
import java.util.Optional;

/**
 * @author Guo.Yang
 * @version 1.0
 * @date 2023/1/15 19:06
 */
public class User {
    private Socket socket;
    private String name;

    public User(Socket socket, String name) {
        this.socket = socket;
        this.name = name;
    }

    public User() {
    }


    public Socket getSocket() {
        return socket;
    }

    public void setSocket(Socket socket) {
        this.socket = socket;
    }

    public String getName() {
        return Optional.ofNullable(name).orElse("");
    }

    public void setName(String name) {
        this.name = name;
    }
}
